package com.personal.exception;


import com.personal.controller.result.BackCode;
import com.personal.controller.result.Result;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ProjectExceptionAdvice {

    @ExceptionHandler(ArithmeticException.class)
    public Result doException(Exception ex){
        System.out.println("异常捕获");
        return new Result(BackCode.SYSTEM_ERR,"请联系后端人员处理",ex.getMessage());
    }
}
